package com.frogs.ucenter.entity;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

public class UserMessageSmsLog implements Serializable {
	private static final long serialVersionUID = 8710582331232974071L;

	/**
	 * This field corresponds to the database column user_message_sms_log.id
	 */
	private Integer id = 0;

	/**
	 * This field corresponds to the database column
	 * user_message_sms_log.message_type
	 */
	private Integer messageType = 0;

	public enum MessageTypeEnum {
		/**
		 * 微信
		 */
		MESSAGE_TYPE_WECHAT(1),
		/**
		 * 短信
		 */
		MESSAGE_TYPE_SMS(2),
		/**
		 * 邮件
		 */
		MESSAGE_TYPE_EMAIL(3),
		/**
		 * 站内短息
		 */
		MESSAGE_TYPE_DIRECT_MESSAGE(4);
		// 定义私有变量
		private int nCode;

		private MessageTypeEnum(int _nCode) {
			this.nCode = _nCode;
		}

		public int getValue() {
			return nCode;
		}
	};

	/**
	 * This field corresponds to the database column user_message_sms_log.send_type
	 */
	private Integer sendType = SendTypeEnum.SEND_TYPE_SYSTEM.getValue();
	
	public void setMessageType(Integer messageType) {
		this.messageType = messageType;
	}

	public void setSendType(Integer sendType) {
		this.sendType = sendType;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public void setContentType(Integer contentType) {
		this.contentType = contentType;
	}

	public enum SendTypeEnum {
		/**
		 * 系统自动发送
		 */
		SEND_TYPE_SYSTEM(1),
		/**
		 * 人工发送
		 */
		SEND_TYPE_MANUAL(2);
		// 定义私有变量
		private int nCode;

		private SendTypeEnum(int _nCode) {
			this.nCode = _nCode;
		}

		public int getValue() {
			return nCode;
		}
	};

	/**
	 * This field corresponds to the database column user_message_sms_log.sender
	 */
	private String sender;

	/**
	 * This field corresponds to the database column user_message_sms_log.receiver
	 */
	private String receiver;
	
	private Integer status = StatusEnum.SEND_WAIT.getValue();

	public void setMessageType(MessageTypeEnum arg) {
		this.messageType = arg.getValue();
	}

	/**
	 * This field corresponds to the database column
	 * user_message_sms_log.create_time
	 */
	private Date createTime = new Date();

	/**
	 * This field corresponds to the database column user_message_sms_log.status
	 */
	public enum StatusEnum {
		/**
		 * 待发送,入库
		 */
		SEND_WAIT(0),
		/**
		 * 发送提起
		 */
		SEND_EXTRACT(1),
		/**
		 * 发送成功
		 */
		SEND_SUCCESS(2),
		/**
		 * 发送失败
		 */
		SEND_ERROR(3);
		// 定义私有变量
		private int nCode;

		private StatusEnum(int _nCode) {
			this.nCode = _nCode;
		}

		public int getValue() {
			return nCode;
		}
	};
	
	private Integer contentType = ContentTypeEnum.SINGLE_SEND.getValue();
	
	public Integer getContentType() {
		return contentType;
	}

	public void setContentType(ContentTypeEnum arg) {
		contentType = arg.getValue();
	}

	public enum ContentTypeEnum {
		
		/**
		 * 单发
		 */
		SINGLE_SEND(0),
		/**
		 * 群发
		 */
		GROUP_SEND(1);
		// 定义私有变量
		private int nCode;

		private ContentTypeEnum(int _nCode) {
			this.nCode = _nCode;
		}

		public int getValue() {
			return nCode;
		}
	};
	
    /**
     * This field corresponds to the database column user_message_sms_log.finish_time
     */
    private Date finishTime =null;

	/**
	 * This field corresponds to the database column user_message_sms_log.parent_id
	 */
	private Integer parentId = 0;

	private UserMessageSmsLog parentUserMessageSmsLog = null;

	private List<UserMessageSmsLog> childUserMessageSmsLogList = null;

	/**
	 * This field corresponds to the database column user_message_sms_log.level
	 */
	private Integer level = 0;
	/**
	 * This field corresponds to the database column
	 * user_message_sms_log.partner_interface
	 */
	private String partnerInterface;

	/**
	 * This method returns the value of the database column user_message_sms_log.id
	 * 
	 * @return the value of user_message_sms_log.id
	 */
	public Integer getId() {
		return id;
	}

	/**
	 * This method sets the value of the database column user_message_sms_log.id
	 * 
	 * @param id
	 *            the value for user_message_sms_log.id
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 * This method returns the value of the database column
	 * user_message_sms_log.message_type
	 * 
	 * @return the value of user_message_sms_log.message_type
	 */
	public int getMessageType() {
		return messageType;
	}

	/**
	 * This method sets the value of the database column
	 * user_message_sms_log.message_type
	 * 
	 * @param messageType
	 *            the value for user_message_sms_log.message_type
	 */
	public void setMessageType(int messageType) {
		this.messageType = messageType;
	}

	/**
	 * This method returns the value of the database column
	 * user_message_sms_log.send_type
	 * 
	 * @return the value of user_message_sms_log.send_type
	 */
	public Integer getSendType() {
		return sendType;
	}

	/**
	 * This method sets the value of the database column
	 * user_message_sms_log.send_type
	 * 
	 * @param sendType
	 *            the value for user_message_sms_log.send_type
	 */
	public void setSendType(SendTypeEnum arg) {
		this.sendType = arg.getValue();
	}

	/**
	 * This method returns the value of the database column
	 * user_message_sms_log.sender
	 * 
	 * @return the value of user_message_sms_log.sender
	 */
	public String getSender() {
		return sender;
	}

	/**
	 * This method sets the value of the database column user_message_sms_log.sender
	 * 
	 * @param sender
	 *            the value for user_message_sms_log.sender
	 */
	public void setSender(String sender) {
		this.sender = sender;
	}

	/**
	 * This method returns the value of the database column
	 * user_message_sms_log.receiver
	 * 
	 * @return the value of user_message_sms_log.receiver
	 */
	public String getReceiver() {
		return receiver;
	}

	/**
	 * This method sets the value of the database column
	 * user_message_sms_log.receiver
	 * 
	 * @param receiver
	 *            the value for user_message_sms_log.receiver
	 */
	public void setReceiver(String receiver) {
		this.receiver = receiver;
	}

	/**
	 * This method returns the value of the database column
	 * user_message_sms_log.create_time
	 * 
	 * @return the value of user_message_sms_log.create_time
	 */
	public Date getCreateTime() {
		return createTime;
	}

	/**
	 * This method sets the value of the database column
	 * user_message_sms_log.create_time
	 * 
	 * @param createTime
	 *            the value for user_message_sms_log.create_time
	 */
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	/**
	 * This method returns the value of the database column
	 * user_message_sms_log.status
	 * 
	 * @return the value of user_message_sms_log.status
	 */
	public Integer getStatus() {
		return status;
	}

	/**
	 * This method sets the value of the database column user_message_sms_log.status
	 * 
	 * @param status
	 *            the value for user_message_sms_log.status
	 */
	public void setStatus(StatusEnum arg) {
		this.status = arg.getValue();
	}

	/**
	 * This method returns the value of the database column
	 * user_message_sms_log.parent_id
	 * 
	 * @return the value of user_message_sms_log.parent_id
	 */
	public Integer getParentId() {
		return parentId;
	}

	/**
	 * This method sets the value of the database column
	 * user_message_sms_log.parent_id
	 * 
	 * @param parentId
	 *            the value for user_message_sms_log.parent_id
	 */
	public void setParentId(Integer parentId) {
		this.parentId = parentId;
		if (parentId != null && parentId > 0) {
			getParentUserMessageSmsLog().id = parentId;
		}
	}

	public UserMessageSmsLog getParentUserMessageSmsLog() {
		if (parentUserMessageSmsLog == null && parentId > 0) {
			parentUserMessageSmsLog = new UserMessageSmsLog();
		}
		return parentUserMessageSmsLog;
	}

	public void setParentUserMessageSmsLog(UserMessageSmsLog parentUserMessageSmsLog) {
		this.parentUserMessageSmsLog = parentUserMessageSmsLog;
		if (parentUserMessageSmsLog != null) {
			parentId = parentUserMessageSmsLog.id;
		}
	}

	public List<UserMessageSmsLog> getChildUserMessageSmsLogList() {
		return childUserMessageSmsLogList;
	}
    /**
     * This method returns the value of the database column user_message_sms_log.finish_time
     *
     * @return the value of user_message_sms_log.finish_time
     */
    public Date getFinishTime() {
        return finishTime;
    }

	public void setChildUserMessageSmsLogList(
			List<UserMessageSmsLog> childUserMessageSmsLogList) {
		this.childUserMessageSmsLogList = childUserMessageSmsLogList;
	}
    /**
     * This method sets the value of the database column user_message_sms_log.finish_time
     *
     * @param finishTime the value for user_message_sms_log.finish_time
     */
    public void setFinishTime(Date finishTime) {
        this.finishTime = finishTime;
    }

	/**
	 * This method returns the value of the database column
	 * user_message_sms_log.level
	 * 
	 * @return the value of user_message_sms_log.level
	 */
	public Integer getLevel() {
		return level;
	}

	/**
	 * This method sets the value of the database column user_message_sms_log.level
	 * 
	 * @param level
	 *            the value for user_message_sms_log.level
	 */
	public void setLevel(Integer level) {
		this.level = level;
	}

	/**
	 * This method returns the value of the database column
	 * user_message_sms_log.partner_interface
	 * 
	 * @return the value of user_message_sms_log.partner_interface
	 */
	public String getPartnerInterface() {
		return partnerInterface;
	}

	/**
	 * This method sets the value of the database column
	 * user_message_sms_log.partner_interface
	 * 
	 * @param partnerInterface
	 *            the value for user_message_sms_log.partner_interface
	 */
	public void setPartnerInterface(String partnerInterface) {
		this.partnerInterface = partnerInterface;
	}
}